import { BinaryDecision } from "framework/FSM/DecisionTree/Decision";
 

/**
 * 资源生产完成,判断任务是否完成了
*/
export class DecisionIsProduceComplete <T extends IStateArg<Room>> extends BinaryDecision<T>
{

    public testValue(arg:T): boolean
    {
        const toptask = arg.entity.getTaskByType("factory")[0]?.data ;
 
        if(toptask)
        {
            return toptask.arg.ProduceList.length== 0
            // return true
        }
        else
        {
            throw new Error(`${arg.entity.GUID} topreactiontask is null`);
        }
        // return false
    }

}

